﻿using System;

class NextDate
{
    static void Main(string[] args)
    {
        System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;

        int inputDay = int.Parse(Console.ReadLine());
        int inputMonth = int.Parse(Console.ReadLine());
        int inputYear = int.Parse(Console.ReadLine());
        DateTime currentDate = new DateTime(inputYear, inputMonth, inputDay);
        DateTime nextDay = currentDate.AddDays(1);
        Console.WriteLine("{0}.{1}.{2}", nextDay.Day, nextDay.Month, nextDay.Year);


    }
}
